
#include <MakeSureFrame.h>
#include <MakeSureXBee802.h>


void setup()
{
  Serial.begin(9600);
  Serial.println("Serial Open");
  
  Serial.println("--------------------------------------------");

  xbee802.ON();
  Serial.println("Xbee Started..");

  xbee802.setAPI(2);
  xbee802.setPowerLevel(4);
  
  //check API & Set API if necessary
  /* if(xbee802.apiValue!=2)
  {
	xbee802.setAPI(0x02);
  Serial.println("API Mode was not Proper...!");
  Serial.println("API Mode Set to API 2");
  }*/
  //xbee802.sendCommandAT("+++");
  //xbee802.sendCommandAT("ATAP#");
  //Serial.println(xbee802.apiValue);
}

void loop()
{

   Serial.println("--------------------------------------------");
   xbee802.getAPI();
  Serial.println("API Mode of Xbee:");
  Serial.println(xbee802.apiValue);


    Serial.println("--------------------------------------------");

  //Check Baud
  xbee802.getBaud();
  Serial.println("Baud Rate:");
  Serial.println(xbee802.baudrate);
  Serial.println("--------------------------------------------");

  //check PAN
xbee802.getPAN();
Serial.println("PAN ID of Module is:");
Serial.println(xbee802.PAN_ID[0], HEX);
Serial.print(xbee802.PAN_ID[1], HEX);

  Serial.println("--------------------------------------------");

//check Channel
    Serial.println("Operational Channel :");

xbee802.getChannel();
Serial.println(xbee802.channel,HEX);

  Serial.println("--------------------------------------------");

//check MAC
xbee802.getOwnMac();
Serial.println("MAC-ID of Module:");
Serial.println(xbee802.sourceMacHigh[0],HEX);
Serial.print(xbee802.sourceMacHigh[1],HEX);
Serial.print(xbee802.sourceMacHigh[2],HEX);
Serial.print(xbee802.sourceMacHigh[3],HEX);
Serial.print(xbee802.sourceMacLow[0],HEX);
Serial.print(xbee802.sourceMacLow[1],HEX);
Serial.print(xbee802.sourceMacLow[2],HEX);
Serial.print(xbee802.sourceMacLow[3],HEX);

  Serial.println("--------------------------------------------");

//check NI
xbee802.getNodeIdentifier();
Serial.println("Node Identifier:");
Serial.println(xbee802.nodeID);

Serial.println("--------------------------------------------");

//check MY
xbee802.getOwnNetAddress();
Serial.println("MY Address:");
Serial.println(xbee802.sourceNA[0],HEX);
Serial.print(xbee802.sourceNA[1],HEX);





}
